Garbage collection is the glorified name for the process of purging the local chunk store of the node. 
Here the assumption is that storage is s scarce resource and with time nodes will experience capacity shortage and face the problem  of deciding which   existing chunks to remove to make space for new arrivals. 

The garbage collection strategy must reflect the economic potential of chunks, i.e., it should ideally maximise the profit the node makes on storage compensation. Deriving high-level behaviour of Swarm as a network from the assumption that nodes employ a particular strategy is only valid if said strategy align best with the incentive design.

If only Swap is operational only a very simple garbage collection strategy is sufficient. Every time a chunk is retrieved, the node serving it earns SWAP revenue. Ideally, then, those chunks that are retrieved more often should be preferred to those retrieved rarely.

The best predictor for number of accesses is number of accesses in the past. For chunks that exist and been retrieved, these models work well, but they are only optimal for making distinctions among popular, not among the rarely accessed content. A priori estimation for new chunks can instead rely on the postage value, which directly  map onto guaranteed revenue.  


available, value consistent storage

indexing by per-chunk balance

updating postage stamp value 

combining swap profit 

Let's  index  the epochs with negative integers with an ordering respecting recency, i.e., the current epoch is 0, the most recent $-1$, the previous one $-2$, etc. 
Let $n$ be the cutoff memory size for past epochs.
Let $\mathit{Hits}(e)$ denote the number of hits a chunk is served during epoch $e$. 

Let's build a popularity predictive model based on past observations using the assumption of exponential decay with time in predictive power. 

\begin{equation}
    \mathit{Hits}(0) \defeq \frac{\sum_{e=0}^n \frac{\mathit{Hits}(e)}{c^e}}{c^{n-1}}
\end{equation}